The present invention relates to instructions used in a graphics processor generally, and more particularly to instructions to read texture information from a memory.
NVIDIA Corporation of Santa Clara, Calif., has developed a revolutionary type of shader for use in graphics processors and similar circuits. This shader receives pixel information (pixel quads) and program instructions, and modifies the pixel information as directed by the program instructions. The shader is made up of several circuits, each of which can typically perform an instruction each shader clock cycle. The several circuits in the shader form a loop around which the pixel information make a number of passes. When the pixel information has been fully processed, the pixels are output from the shader.
One particular instruction is an instruction to read a texture from memory for use by the shader. This instruction is performed by a circuit associated with the shader, specifically a texture circuit or texture filter. This texture circuit may be though of either as a separate circuit from the shader, or simply as a circuit in the shader.
The texture circuit is capable of reading a number of bits from memory during one clock cycle. Unfortunately, a texture is often larger than this number. Accordingly, multiple clock cycles, and therefore multiple passes, are needed to read an entire texture from memory. This has a detrimental effect on shader performance. Since it takes multiple passes, for example 2 or 4 passes through a shader to read a texture, the other shader circuits are not being utilized fully.
Thus, what is needed, are circuit, methods, and apparatus that allow the other circuits in the shader to be utilized while a texture is being read over multiple passes through a shader. Since such as shader could perform several instructions while a texture is being read, it would also be useful if these circuits, methods, and apparatus reorder or rearrange instructions such that other instructions are put ahead of instructions that require the texture that is being read.